var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/getstudent', function(req, res, next) {
 
      res.json({'id':1,
              "name":"前后端分离",
              'classBean':{'id':1,"name":'班级1'}
            })  
      //获得前端的函数名
     /* let callback = req.query.callback;
     console.log(callback);
     res.end(`${callback}({'id':1,
     "name":"前后端分离",
     'classBean':{'id':1,"name":'班级1'}
   })`)  */
 
});

router.post("/add",(req,res)=>{

  res.json({"code":1,"msg":"添加成功"})
})

module.exports = router;